package com.xcdh.commons.exception;

import com.xcdh.domain.vo.R;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@RestControllerAdvice
@Slf4j
public class GlobalExceptionHandler {

    @ExceptionHandler(value = Exception.class)
    public R handlerException(Exception e){
        log.error(e.getMessage());
        e.printStackTrace();
        return R.error(e.getMessage()) ;
    }

}
